#ifndef G3_TIMER_H
#define G3_TIMER_H

#include <SDL/SDL.h>

namespace G3 {

class FPS_COUNTER {
	public:
		FPS_COUNTER ();
		// Ticks
		long StartCount;
		long EndCount;
		long LastDelta;
		// Frames
		long FrameCount;
		// Frames per second
		double LastFPS;
		double FPS;

//==============================================================================
// Starts or restarts the FPS counter
//==============================================================================
		void Start ();

//==============================================================================
// Marks another frame as rendered
//
//	Returns the number of frames already rendered within this second
//==============================================================================
		long AddFrame ();

//==============================================================================
// Checks time and updates the FPS variable
//==============================================================================
		void CheckTime ();
};

class TIMER {
	public:
		TIMER ();

		long StartCount;

//==============================================================================
// Starts or restarts the timer
//==============================================================================
		void Start ();

//==============================================================================
// Checks time and returns the number of ticks since the last check
//==============================================================================
		long CheckTime ();

//==============================================================================
// Returns the elapsed time since the last check
//==============================================================================
		long GetElapsedTime ();
};

};

#endif //G3_TIMER_H
